﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DemoObject;
using BusinessObjects;

public partial class Module_News_Controls_NewsItemHome : System.Web.UI.UserControl
{
    public Guid CategoryId { get; set; }
    public string CategoryName { get; set; }
    public string CategoryTextId { get; set; }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            HashSet<string> hs = new HashSet<string>();
            hs.Add("DisplayOrder ASC");
            int count = 0;
            IList<TblNews> ls = TblNewsRepository.CreateInstant().SelectListItem(null, CategoryId, "", "", "", "", true, null, true, 1, 6, out count, hs);
            List<TblNews> ls1 = new List<TblNews>(); ;
            if (ls.Count > 0)
            {
                ls1.Add(ls[0]);
                ls.RemoveAt(0);
                CategoryName = ls1[0].TblCategory.Name;
                CategoryTextId = ls1[0].TblCategory.TextId;
            }
            rpt.DataSource = ls1;
            rpt.DataBind();
            rptmore.DataSource = ls;
            rptmore.DataBind();
        }
    }
}
